<?php
/**
 * Created by PhpStorm.
 * User: mojie126
 * Date: 2017/9/5 0005
 * Time: 下午 17:51
 */

namespace app\index\controller;


use app\common\rbac;

class TestController extends Base
{
	public function index()
	{
		$uid = session("uid");
		dump(rbac::getGroupNameFromUID($uid));
	}

	private $host = "https://imgsha.com";
	private $key = "49b0c698221cc6ba77010966538031fd";
	private $action = "/api/1/upload";
	private $h = "http://p.wocnm.com/api/1/upload";
	private $k = "a7595d39a5e831c813a697cc841439f6";

	public function upload()
	{
		$this->assign("title", "上传");

		return $this->fetch();
	}

	public function doUpload()
	{
		$data = mycurl($this->host . $this->action, ["key" => $this->key, "source" => base64EncodeImage($_FILES['file']['tmp_name'])], TRUE);
		jsonReturn(0, "", $data);
	}


}